﻿
using Db7;
using System.Collections.Generic;
using Db7_ut.DomainObjects;
namespace Db7_ut.Views.Tables
{
    public class EmployeeListing
    {

        EmployeeList _employees;
        List<Column> _columns = new List<Column>();
        string _ContainerID;

        public EmployeeListing(string ContainerID)
        {

            this._ContainerID = ContainerID;
            this._employees = new EmployeeList();
            this._employees.Populate(OnPopulate);

           
            
        }

        public void OnPopulate()
        {
            #region Column Model

            Column colID = new Column(); _columns.Add(colID);
            colID.HeaderText = "ID";
            colID.RowIndexToBodyCellContent = delegate(int ithRow)
            {
                return this._employees.Employees[ithRow].ID;
            };
            #endregion
            VTable table = new VTable();
            table.Columns = _columns;
            table.NumberOfRows_D = this._employees.Employees.Count;
            table.RenderInside(_ContainerID);
        }
    }
}
